<?php  
$this->_arrParam['action'] = Yii::app()->controller->action->id;
$this->_arrParam['module'] = Yii::app()->controller->module->id  ;
$this->_arrParam['id'] = $model->id;
$page = '';
//if( !empty( $pages ) ){
//        $page = '/?page=' . $pages->currentPage+1;
//}
$image = Yii::app()->baseUrl.'/assets/img/admin/toolbar/icon-32-publish.png';
$ActiveItems = $this->_arrParam['controller'].'/status?type=1';
$btnActiveItems = ExtendHelpers::cmsButton( 'Bật', $ActiveItems, $image, 'submit' );

// 2. Inactive Items - submit
$image = Yii::app()->baseUrl.'/assets/img/admin/toolbar/icon-32-unpublish.png';
$UrlInactiveItems = $this->_arrParam['controller'].'/status?type=1';
$btnInactiveItems = ExtendHelpers::cmsButton( 'Tắt', $UrlInactiveItems, $image, 'submit' );

$image = Yii::app()->baseUrl.'/assets/img/admin/toolbar/icon-32-new-bk.png';
$UrlNew = $this->_arrParam['controller'].'/create';
$btnAddNew = ExtendHelpers::cmsButton( 'New', $UrlNew, $image, 'link' );

$image = Yii::app()->baseUrl.'/assets/img/admin/toolbar/icon-32-delete.png';
$UrlDelete = $this->_arrParam['controller'].'/muldelete';
$btnMulDelete = ExtendHelpers::cmsButton( 'Delete', $UrlDelete, $image, 'submit' );

$image = Yii::app()->baseUrl.'/assets/img/admin/toolbar/icon-32-save.png';
if($this->_arrParam['action'] == 'create'){
		$UrlSave = 'create';
	}else{
		$UrlSave = $this->_arrParam['id'];
	}
$btnSaveItem = ExtendHelpers::cmsButton( 'Lưu', $UrlSave, $image, 'submit' );

$image = Yii::app()->baseUrl.'/assets/img/admin/toolbar/icon-32-cancel.png';
$UrlCancel = $this->_arrParam['controller'].'/index';
$btnCancel = ExtendHelpers::cmsButton( 'Hủy', $UrlCancel, $image, 'link' );

$btnAccept = '';
$layout_title = '';
switch ($this->_arrParam['action']) {

    case 'index': $strBtn = $btnAddNew.$btnActiveItems.$btnInactiveItems.$btnMulDelete;$layout_title='Sự kiện::Danh sách sự kiện';
        break;
    
    case 'create': $strBtn = $btnSaveItem . ' ' . $btnCancel;$layout_title='Sự kiện::Thêm mới';
        break;
    
    case 'update': $strBtn = $btnSaveItem . ' ' . $btnCancel;$layout_title='Sự kiện::Sửa';
        break;
    
    case 'delete': $strBtn = $btnAccept . ' ' . $btnCancel;
        break;
    
    default: $strBtn = '';
}

//Icon toolbar
$IconToolbar = 'icon-48-user';
?>
<div class="block_toolbar goc10">
    <div class="toolbar">
        <?php echo $strBtn; ?>
        <div class="clr"></div>
    </div>
    <div class="header <?php echo $IconToolbar; ?>"><?php echo $layout_title; ?></div>
    <div class="clr"></div>
</div>  
<?php
    //echo ExtendHelpers::test();     
?>